<?
	/* View */
	define('PS', 1);
	include_once("../../defines.php");
	
	include_once('header.php');
	$class_id = $_REQUEST['id'];
	
	$PageName = 'tournaments';
	include_once(PUBLIC_BEHIND_DIRECTORY . $PageName . '.php');
?>

<script type="text/javascript">
	$(function(){

	});
</script>
	
<div id="linksContent" class="centerContent">
	<h1 class="titlePage"><?= $categorySelected->getDescription();?></h1>
	<div id="tournamentsList">
	<?
	$totalTournaments = count($arrTournaments);
	
	if (!$totalTournaments)
		echo '<h3 class="centerContent bold empty">NO HAY TORNEOS PARA VISUALIZAR.</h3>';
	else
		echo '<h4 id="enterToTournament" class="uppercase">[ Presione en alg&uacute;n torneo para acceder a &eacute;l ]</h4>
			<div class="clear"></div>';
	
	foreach ($arrTournaments as $Tournament){
	?>
		<div class="tournamentSingle inlineBlock" data-path="torneo" data-parameters="id=<?= $Tournament->getId();?>&name=<?= $Tournament->getUrl();?>">
		<?
			$logo = $Tournament->getImage();

			if (empty($logo)){
				$logo = NO_IMAGE;
			}else{
				$logo = MAIN_TOURNAMENTLOGO_NEWS_PATH . $logo;
			}
			if (!empty($logo)){
		?>
			<img src="<?= $logo ?>" alt="<?=$Tournament->getName();?>" class="miniLogo left inlineBlock" />
			<div class="tournamentDescription">
				<span class="miniTitleTournament"><?= $Tournament->getName(); ?></span><br />
				<span class="miniDateTournament">
					Inicia: <?= FunctionsHelper::adaptListFormatDate($Tournament->getInitialDate());?><br />
					Finaliza: <?= FunctionsHelper::adaptListFormatDate($Tournament->getFinalDate());?>
				</span>
			</div>
		<?
			}
		?>
		</div>
	<?
	}
	?>
	</div>
</div>